import request from '../utils/request.js'
/**
 * 获取资产信息
 * @param {*} query
 * @returns
 */
export function getOranizerList(query) {
    return request({
        url: '/organizer/equipments/list/',
        method: 'get',
        params: query
    })
}

export function addpentOranizer(data) {
    return request({
        url: '/organizer/equipments/',
        method: 'post',
        data
    })
}

export function updataOranizerList(id, data) {
    return request({
        url: `/organizer/equipments/${id}/`,
        method: 'put',
        data
    })
}

export function deleteOranizer(id) {
    return request({
        url: `/organizer/equipments/${id}/`,
        method: 'delete'
    })
}

export function getAssetDetail(query) {
    return request({
        url: `/organizer/equipments/${query.dev_base_id}/`,
        method: 'get'
    })
}




// 参数总表数据
export function getParamentList(query) {
    return request({
        url: '/analysis-mang/analysis-item/datas/realtime/equip/',
        method: 'get',
        params: query
    })
}

// 传感器列表获取数据
export function getSensorList(query) {
    return request({
        url: '/device-mang/devices/adv/list/',
        method: 'get',
        params: query
    })
}

// 传感器添加数据
export function addpentSensor(id, data) {
    return request({
        url: `/device-mang/devices/adv/${id}/`,
        method: 'patch',
        data
    })
}

// 关联资产装置
export function relevanceAssic(data) {
    return request({
        url: `/organizer/companys/equipment/`,
        method: 'put',
        data
    })
}

// 关联设备
export function relevanceDevice(data) {
    return request({
        url: `/organizer/companys/device/`,
        method: 'put',
        data
    })
}

// 关联监测点位
export function relevancePoint(data) {
    return request({
        url: `/organizer/companys/point/`,
        method: 'put',
        data
    })
}
// 上传文件
export function formFileFun(data) {
    return request({
        url: '/bms/files/updownload/',
        method: 'post',
        data
    })
}